package com.gxa.clientorder.service.impl;

import com.gxa.clientorder.mapper.SendoutMapper;
import com.gxa.clientorder.pojo.Sendout;
import com.gxa.clientorder.service.SendoutService;
import com.gxa.clientorder.utils.CreateNumber;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author FanJiang
 * @Date 2020/11/13
 * @Version 1.0
 */
@Service("sendoutService")
public class SendoutServiceImpl implements SendoutService {

    @Resource
    SendoutMapper sendoutMapper;

    /**
     * 发货接口
     * @param sendout sendout对象
     * @return
     */
    @Override
    public Integer insert(Sendout sendout) {

        //设置操作时间为当前时间
        sendout.setInputDate(new Date());
        sendout.setSendDate(new Date());
        //1/已发货、2/正常、未发货
        sendout.setSenstate(1);
        return sendoutMapper.insertSelective(sendout);
    }

    /**
     * 发货列表接口
     * @param outnum 发货单流水号
     * @param ordnum 订单号
     * @param username 收货人
     * @param senstate 发货单状态
     * @return list数据列表
     */
    @Override
    public List senlist(String outnum, String ordnum, String username, Integer senstate) {
        return sendoutMapper.senlist(outnum,ordnum,username,senstate);
    }

}
